<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    {CSS href="__STATIC__/admin/css/admin_base.css" /}
    {js href='__STATIC__/jquery/jquery-1.11.0.min.js' /}
    {js href='__STATIC__/layui/layui.js' /}
    {CSS href="__STATIC__/layui/css/layui.css" /}
    {CSS href="__STATIC__/icon/icon.css" /}
    {block name="jscss"}{/block}


    {CSS href="__STATIC__/sortable/sortable.min.css" /}
    {js href='__STATIC__/sortable/sortable.min.js' /}

  
</head>
<body style="background: #ffffff;">


<div style="padding: 0px 10px 0px 10px">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li {eq name="from_type" value="0"}class="layui-this"{/eq}><a href="{:url('admin/Material/getSendMaterial',['type'=>'image','from_type'=>0])}">本地素材</a></li>
            <li {eq name="from_type" value="1"}class="layui-this"{/eq}><a href="{:url('admin/Material/getSendMaterial',['type'=>'image','from_type'=>1])}"> 微信服务器</a></li>

        </ul>
    </div>


</div>
<div class="layui-tab-content">

    <div class="layui-tab-item layui-show">

    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li {eq name="type" value="image"}class="layui-this"{/eq}><a href="{:url('admin/Material/getSendMaterial',['type'=>'image','from_type'=>$from_type])}">图片</a></li>
            <li {eq name="type" value="news"}class="layui-this"{/eq}><a href="{:url('admin/Material/getSendMaterial',['type'=>'news','from_type'=>$from_type])}">图文</a></li>
            <!--<li {eq name="type" value="voice"}class="layui-this"{/eq}><a href="{:url('admin/Material/getSendMaterial',['type'=>'voice','from_type'=>$from_type])}">语音</a></li>-->
            <!--<li {eq name="type" value="video"}class="layui-this"{/eq}><a href="{:url('admin/Material/getSendMaterial',['type'=>'video','from_type'=>$from_type])}">视频</a></li>-->
            {eq name="from_type" value="0"}
            <li {eq name="type" value="activity"}class="layui-this"{/eq}><a href="{:url('admin/Material/getSendMaterial',['type'=>'activity','from_type'=>$from_type])}">活动</a></li>
            <li {eq name="type" value="text"}class="layui-this"{/eq}><a href="{:url('admin/Material/getSendMaterial',['type'=>'text','from_type'=>$from_type])}">文本</a></li>
            {/eq}
        </ul>


            <div class="layui-tab-content">
            {switch name="type"}
            {case value="news"}
            <ul class="sortable__nav nav" style="display: none;">
                <li>
                    <a data-sjslink="all" class="nav__link">
                        All
                    </a>
                </li>

            </ul>
            <div id="sortable" class="sjs-default">
                {volist name="data" id="val"}
                <div data-sjsel="flatty" class="" onclick="returnV('{$val.id}','news');">
                    <div class="sort-card media-news-body" style="margin: 0;">
                        <div class="media-news-time">
                            发布时间：{$val.create_time}
                        </div>
                        <span style="display: block;">
                                    {volist name="val.news_item" id="item" offset="0" length="1"}
                                    <div class="media-news-content">
                                        <div class="media-news-desc"><p
                                                class="media-news-desc-sp">{$item.title}</p></div>
                                        <img class="media-news-img"
                                             src="{$item.thumb_url}" alt="">
                                    </div>
                                     {/volist}
                                </span>
                        <div>
                            <ul>
                                {volist name="val.news_item" id="item" offset="1" length="10"}
                                <li>
                                    <div class="mdedia-news-lists-box">
                                        <div class="media-news-title-box layui-col-md9">
                                            {$item.title}
                                        </div>
                                        <div class="media-news-img-box layui-col-md3"><img class="media-news-lists-img" src="{$item.thumb_url}" alt="">
                                        </div>
                                    </div>
                                </li>
                                {/volist}
                            </ul>
                        </div>

                    </div>
                </div>
                {/volist}
            </div>


            {$page|raw}
            {/case}
            {case value="activity"}
            <div class="layui-tab-item  layui-show">
                <div class="layui-row">
                    {volist name="data" id="val"}
                    <div class=" rhaphp-media-news" onclick="returnV('{$val.id}','activity');" style="width: 50%;float: left;">
                        <div class="media-news-body">
                            <div class="media-news-time">
                                发布时间：{$val.create_time}
                            </div>
                            <span style="display: block;">

                                    <div class="media-news-content">
                                        <div class="media-news-desc"><p
                                                class="media-news-desc-sp">{$val.title}</p></div>
                                        <img class="media-news-img"
                                             src="{$val.url}">
                                    </div>

                                </span>
                            <div>
                            </div>

                        </div>
                    </div>

                    {/volist}
                </div>
            </div>
            {$data->render()|raw}
            {/case}
                {case value="text"}
                <div class="layui-tab-item  layui-show">
                    <div class="layui-row">
                        {volist name="data" id="val"}
                        <div class=" rhaphp-media-news" onclick="returnV('{$val.id}','text');" style="width: 50%;float: left;">
                            <div class="media-news-body">
                                <div class="media-news-time">
                                    发布时间：{$val.create_time}
                                </div>
                                <div style="height: 60px;overflow: auto;">
                                    {$val.content}
                                </div>

                            </div>
                        </div>

                        {/volist}
                    </div>
                </div>
                {$data->render()|raw}
                {/case}
            {case value="image"}
            <ul class="type_image">
                {volist name="data" id="v"}
                <li class="material_li" onclick="returnV('{$v.id}','image');">
                    <span><img src="{$v.url}" width="169" height="169"></span>
                </li>

                {/volist}
            </ul>
            {$data->render()|raw}
            {/case}

            {/switch}
        </div>
    </div>

</div>
</div>

<script type="text/javascript">

        if(document.getElementById("sortable")){
            document.querySelector('#sortable').sortablejs();
        }



</script>

<script>

    function returnV(value,type) {

        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
//        parent.parent.controllerByVal1(value,type,'{$from_type}');
        parent.controllerByVal1(value,type,'{$from_type}');
        parent.layer.close(index);
    }

</script>
</body>
</html>